{extend name="base" /}
{block name="css"}
{css href="__CSS__/orders.css" /}
{/block}
{block name="body"}
<!-- 主要内容 开始 -->
<div class="weui-tab__bd-item">
  <header class="weui-navBar weui-navBar-fixed">
    <a href="javascript:history.go(-1);" class="weui-navBar-item">
      <i class="icon iconfont icon-fanhui"></i>
    </a>
    <div class="weui-center">
      <span class="weui-center-title">我的订单</span>
    </div>
    <a href="javascript:;" class="weui-navBar-item">
    </a>
  </header>
  <div class="weui-tab">
      <div class="weui-navbar">
        <a class="weui-navbar__item weui-bar__item--on" href="#tab1">
          全部
        </a>
        <a class="weui-navbar__item " href="#tab2">
          未付款
        </a>
        <a class="weui-navbar__item" href="#tab3">
          待发货
        </a>
        <a class="weui-navbar__item" href="#tab4">
          待收货
        </a>
        <a class="weui-navbar__item" href="#tab5">
          已完成
        </a>
      </div>
      <div class="weui-tab__bd">
        <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
          <div class="weui-loadmore weui-loadmore_line">
            <span class="weui-loadmore__tips">全部</span>
          </div>
          {volist name="$data" id="v" empty="$empty"}
            <a href="/order_detail/code/{$v.id|md6}.html">{$v.goods_name}</a>
            <button class="weui-btn weui-btn_mini weui-btn_primary" data-url="/express/code/{$v.id|md6}.html">物流查询</button>
          {/volist}
        </div>
        <div id="tab2" class="weui-tab__bd-item">
          <div class="weui-loadmore weui-loadmore_line">
            <span class="weui-loadmore__tips">未付款</span>
          </div>
          {volist name="$data" id="v" empty="$empty"}
            {if $v.pay_status eq 0}
              <a href="/order_detail/code/{$v.id|md6}.html">{$v.goods_name}</a>
              <button class="weui-btn weui-btn_mini weui-btn_primary" data-url="/express/code/{$v.id|md6}.html">物流查询</button>
            {/if}
          {/volist}
        </div>
        <div id="tab3" class="weui-tab__bd-item">
          <div class="weui-loadmore weui-loadmore_line">
            <span class="weui-loadmore__tips">待发货</span>
          </div>
          {volist name="$data" id="v" empty="$empty"}
            {if $v.pay_status eq 1 && $v.shipping_status eq 0}
              <a href="/order_detail/code/{$v.id|md6}.html">{$v.goods_name}</a>
              <button class="weui-btn weui-btn_mini weui-btn_primary" data-url="/express/code/{$v.id|md6}.html">物流查询</button>
            {/if}
          {/volist}
        </div>
        <div id="tab4" class="weui-tab__bd-item">
          <div class="weui-loadmore weui-loadmore_line">
            <span class="weui-loadmore__tips">待收货</span>
          </div>
          {volist name="$data" id="v" empty="$empty"}
            {if $v.pay_status eq 1 && $v.shipping_status eq 1}
              <a href="/order_detail/code/{$v.id|md6}.html">{$v.goods_name}</a>
              <button class="weui-btn weui-btn_mini weui-btn_primary" data-url="/express/code/{$v.id|md6}.html">物流查询</button>
            {/if}
          {/volist}
        </div>
        <div id="tab5" class="weui-tab__bd-item">
          <div class="weui-loadmore weui-loadmore_line">
            <span class="weui-loadmore__tips">已完成</span>
          </div>
          {volist name="$data" id="v" empty="$empty"}
            {if $v.order_status eq 2}
              <a href="/order_detail/code/{$v.id|md6}.html">{$v.goods_name}</a>
              <button class="weui-btn weui-btn_mini weui-btn_primary" data-url="/express/code/{$v.id|md6}.html">物流查询</button>
            {/if}
          {/volist}
        </div>
      </div>
    </div>
</div>
<!-- 主要内容 结束 -->
{/block}
{block name="js"}
<script type="text/javascript">
  $(function() {
    $('.weui-btn_primary').click(function() {
      $(location).attr('href', $(this).data('url'));
    });
  });
</script>
{/block}